import numpy as np
import pandas as pd

def eval_balance(e_b_blue, e_r_blue, e_b_red, e_r_red):
    """
    Evaluate the balancedness of the group errors
    """
    res = ''
    if e_b_red < e_r_red:
        res = 'b-skewed'
    elif e_r_blue < e_b_blue:
        res = 'r-skewed'
    elif np.isnan(e_b_blue) or np.isnan(e_r_blue) or np.isnan(e_b_red) or np.isnan(e_r_red):
        res = 'nan'
    else:
        res = 'group-balanced'
    return res
